#include "util/tc_singleton.h"
using namespace taf;

class B : public TC_Singleton<B, CreateStatic, PhoneixLifetime>
//class B : public TC_Singleton<B, CreateStatic, DefaultLifetime>
{
    public:
        B() { cout << "B" << endl; }
        ~B() { cout << "~B" << endl; }
        void test() { cout << "test B" << endl; }
};

class A : public TC_Singleton<A, CreateStatic, PhoneixLifetime>
{
    public:
        A() { cout << "A" << endl; }
        ~A() { cout << "~A" << endl; B::getInstance()->test(); }
        void test() { cout << "test A" << endl; }
};

void func()
{
    A::getInstance()->test();
    B::getInstance()->test();
}

int main(int argc, char** argv)
{
    func();
    cout << "func over" << endl;
    string s = "";
    cout << s.empty() << endl;
    
    
    return 0;
}
